/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    input, textarea {
        -webkit-user-select: auto;
        user-select: auto;
    }

    /* 状态栏适配 */
    .chat-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #111111 25%, #1a1a1a 50%, #111111 75%, #000000 100%);
    background-size: 400% 400%;
    animation: darkGradient 20s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 黑色渐变动画 */
@keyframes darkGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 动态粒子效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(1px 1px at 50px 50px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 150px 100px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 250px 150px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 350px 80px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 450px 120px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(2px 2px at 80px 200px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 180px 250px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 280px 300px, rgba(255, 255, 255, 0.8), transparent);
    background-repeat: repeat;
    background-size: 500px 350px;
    animation: particles 25s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* 第二层粒子效果 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(1px 1px at 100px 80px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 200px 160px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 300px 220px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 400px 140px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 120px 280px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 320px 350px, rgba(255, 255, 255, 0.5), transparent);
    background-repeat: repeat;
    background-size: 600px 400px;
    animation: particles2 30s linear infinite reverse;
    pointer-events: none;
    z-index: 0;
}

/* 粒子动画 */
@keyframes particles {
    0% {
        transform: translateY(0px) translateX(0px);
        opacity: 1;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-10px) translateX(-15px);
        opacity: 0.6;
    }
    75% {
        transform: translateY(-30px) translateX(5px);
        opacity: 0.9;
    }
    100% {
        transform: translateY(-50px) translateX(-10px);
        opacity: 0.3;
    }
}

/* 第二层粒子动画 */
@keyframes particles2 {
    0% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.5;
    }
    33% {
        transform: translateY(-15px) translateX(-8px);
        opacity: 0.7;
    }
    66% {
        transform: translateY(-25px) translateX(12px);
        opacity: 0.4;
    }
    100% {
        transform: translateY(-40px) translateX(-5px);
        opacity: 0.2;
    }
}

/* 聊天容器 */
.chat-container {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.98) 50%,
    rgba(255, 255, 255, 0.95) 100%
    );
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 80px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(25px);
    border: 2px solid transparent;
    background-clip: padding-box;
    animation: containerGlow 8s ease-in-out infinite;
}

/* 容器发光动画 */
@keyframes containerGlow {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 80px rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 120px rgba(255, 255, 255, 0.1);
    }
}

/* 头部样式 */
.chat-header {
    background: linear-gradient(135deg, #07C160 0%, #06A84F 50%, #07C160 100%);
    background-size: 200% 200%;
    animation: headerGlow 6s ease infinite;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(7, 193, 96, 0.4),
    0 0 40px rgba(7, 193, 96, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

/* 头部发光动画 */
@keyframes headerGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 2px 20px rgba(7, 193, 96, 0.4),
        0 0 40px rgba(7, 193, 96, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 2px 30px rgba(7, 193, 96, 0.6),
        0 0 60px rgba(7, 193, 96, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* 头部闪光效果 */
.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.1);
}

.header-left i {
    font-size: 28px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.online-count {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.connection-status.connected {
    color: white;
}

.connection-status.disconnected {
    color: #f44336;
}

/* 头部按钮样式 */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.header-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.header-btn:hover::before {
    left: 100%;
}

/* 重连按钮特殊样式 */
#reconnectBtn {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    animation: pulse 2s infinite;
}

#reconnectBtn:hover {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.8);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
    to {
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #07C160;
    color: white;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 30px;
}

.modal-body p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

#nicknameInput {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

#nicknameInput:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.nickname-tips {
    margin-top: 10px;
}

.nickname-tips p {
    font-size: 14px;
    margin-bottom: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 3px solid #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nickname-tips p i {
    font-size: 16px;
}

.modal-footer {
    padding: 0 30px 30px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-primary {
    background: #07C160;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(7, 193, 96, 0.4);
    background: #06A84F;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 聊天主区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 消息样式 */
.message {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 20px;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
    word-wrap: break-word;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.own {
    align-self: flex-end;
    background: linear-gradient(135deg, #95EC69 0%, #7ED321 100%);
    color: #333;
    border-bottom-right-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.message.own:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(149, 236, 105, 0.4);
}

.message.own::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.message.own:hover::before {
    left: 100%;
}

.message.other {
    align-self: flex-start;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.message.other:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.message.system {
    align-self: center;
    background: #F0F0F0;
    color: #666;
    border-radius: 20px;
    font-size: 14px;
    text-align: center;
    max-width: 80%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.message.own .message-header {
    color: rgba(51, 51, 51, 0.7);
}

.message.other .message-header {
    color: #666;
}

.sender-name {
    font-weight: 600;
}

.message-time {
    opacity: 0.7;
}

.message-content {
    font-size: 16px;
    line-height: 1.4;
}

/* 消息中的链接样式 */
.message-link {
    color: #07c160;
    text-decoration: none;
    border-bottom: 1px solid rgba(7, 193, 96, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(7, 193, 96, 0.05);
    transition: all 0.2s ease;
    font-weight: 500;
    word-break: break-all;
}

.message-link:hover {
    color: #06ae56;
    background: rgba(7, 193, 96, 0.1);
    border-bottom-color: rgba(7, 193, 96, 0.6);
    text-decoration: none;
}

.message-link:active {
    background: rgba(7, 193, 96, 0.15);
    transform: translateY(1px);
}

/* 自己发送的消息中的链接样式 */
.message.own .message-link {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.message.own .message-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

/* 链接图标样式 */
.message-link i {
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message-link:hover i {
    opacity: 1;
}

/* 输入区域 */
.input-container {
    background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(248, 249, 250, 0.95) 100%
    );
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
    );
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

#messageInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    resize: none;
}

#messageInput:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.send-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #07C160, #06A84F);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.3),
    0 0 20px rgba(7, 193, 96, 0.2);
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(7, 193, 96, 0.6),
    0 0 40px rgba(7, 193, 96, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #06A84F, #05954A);
}

.send-btn:hover::before {
    left: 100%;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 图片按钮样式 */
.image-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3),
    0 0 20px rgba(255, 107, 53, 0.2);
}

.image-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.image-btn:hover:not(:disabled) {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6),
    0 0 40px rgba(255, 107, 53, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #F7931E, #E8851B);
}

.image-btn:hover::before {
    left: 100%;
}

.image-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-footer {
    display: flex;
    align-items: center;
}

.input-footer .button-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.input-footer .char-count {
    margin-left: auto;
}

.input-footer .emoji-btn,
.input-footer .sticker-btn {
    flex-shrink: 0;
}

.input-footer .char-count {
    flex-shrink: 0;
}

.emoji-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.emoji-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
    color: #07C160;
}

/* 表情包按钮样式 */
.sticker-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.sticker-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
    color: #07C160;
}

/* 礼物按钮样式 */
.gift-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.gift-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
    color: #ff6b6b;
}

.char-count {
    font-size: 12px;
    color: #999;
}

/* Emoji面板 */
.emoji-panel {
    position: absolute;
    bottom: 120px;
    left: 30px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 999;
}

.emoji-panel.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表情包加载动画 */
@keyframes stickerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.emoji {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.emoji:hover {
    background: #f0f0f0;
    transform: scale(1.2);
}

/* 通知样式 */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    border-left: 4px solid #07C160;
}

.notification.error {
    border-left: 4px solid #f44336;
}

.notification.info {
    border-left: 4px solid #2196F3;
}

/* 滚动条样式 */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }

    .chat-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-left {
        flex: 1;
        min-width: 0;
        gap: 10px;
    }

    .header-left h1 {
        font-size: 16px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .logo-icon {
        flex-shrink: 0;
    }

    .logo-icon svg {
        width: 24px;
        height: 24px;
    }

    .header-right {
        gap: 8px;
        flex-shrink: 0;
    }

    .online-count {
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 12px;
        min-width: 0;
    }

    .online-count i {
        font-size: 12px;
    }

    .connection-status {
        font-size: 12px;
        gap: 4px;
    }

    .connection-status i {
        font-size: 12px;
    }

    .header-buttons {
        gap: 6px;
    }

    .header-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .message {
        max-width: 85%;
    }

    .input-container {
        padding: 12px 16px;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .notification {
        min-width: auto;
    }
}

/* 小屏幕适配 (手机竖屏) */
@media (max-width: 480px) {
    .chat-header {
        padding: 10px 12px;
    }

    .header-left h1 {
        font-size: 14px;
        max-width: 120px;
    }

    .logo-icon svg {
        width: 20px;
        height: 20px;
    }

    .online-count {
        padding: 3px 6px;
        font-size: 11px;
        gap: 4px;
    }

    .connection-status {
        font-size: 11px;
        gap: 3px;
    }

    .header-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .header-buttons {
        gap: 4px;
    }
}

/* 横屏适配 */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-container {
        height: 100vh;
    }

    .chat-header {
        padding: 8px 16px;
    }

    .header-left h1 {
        font-size: 15px;
    }

    .online-count {
        padding: 3px 8px;
        font-size: 11px;
    }

    .connection-status {
        font-size: 11px;
    }
}

/* 移动端头部特殊优化 */
@media (max-width: 768px) {
    /* 头部渐变优化 */
    .chat-header {
        background: linear-gradient(135deg, #07C160 0%, #06A84F 100%);
        box-shadow: 0 1px 10px rgba(7, 193, 96, 0.3),
        0 0 20px rgba(7, 193, 96, 0.1);
    }

    /* 头部元素间距优化 */
    .header-left {
        overflow: hidden;
    }

    /* 在线人数显示优化 */
    .online-count {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* 连接状态优化 */
    .connection-status {
        background: rgba(255, 255, 255, 0.1);
        padding: 2px 6px;
        border-radius: 8px;
        backdrop-filter: blur(5px);
    }

    /* 头部按钮触摸优化 */
    .header-btn {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.2s ease;
    }

    .header-btn:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.25);
    }

    /* 标题文字阴影 */
    .header-left h1 {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .chat-header {
        padding: 8px 10px;
    }

    .header-left h1 {
        font-size: 13px;
        max-width: 100px;
    }

    .online-count span {
        display: none;
    }

    .online-count::after {
        content: attr(title);
        font-size: 10px;
    }

    .connection-status span:not(.fas) {
        display: none;
    }
}

/* 图片消息样式 */
.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 图片加载状态 */
.image-loading {
    display: inline-block;
    width: 200px;
    height: 150px;
    background: #f0f0f0;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

/* 视频消息样式 */
.message.video-message {
    max-width: 320px;
}

.video-message-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-description {
    margin: 0;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.message.own .video-description {
    color: #333;
}

.video-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid #e0e0e0;
}

.message-video {
    width: 100%;
    /*max-width: 280px;*/
    /*max-height: 200px;*/
    height: auto;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.video-info {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

.video-title {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-title::before {
    content: '🎬';
    font-size: 12px;
}

/* 视频消息悬停效果 */
.message.video-message:hover .video-container {
    border-color: #07C160;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.1);
}

/* 自己发送的视频消息样式 */
.message.own.video-message .video-container {
    background: rgba(149, 236, 105, 0.1);
    border-color: rgba(149, 236, 105, 0.3);
}

.message.own.video-message:hover .video-container {
    border-color: #95EC69;
    box-shadow: 0 2px 8px rgba(149, 236, 105, 0.2);
}

/* 视频播放器控制栏样式 */
.message-video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.4));
    height: 30px;
}

.message-video::-webkit-media-controls-play-button {
    width: 24px;
    height: 24px;
}

.message-video::-webkit-media-controls-timeline {
    height: 4px;
}

.message-video::-webkit-media-controls-current-time-display,
.message-video::-webkit-media-controls-time-remaining-display {
    font-size: 11px;
}

.message-video::-webkit-media-controls-volume-slider {
    width: 50px;
}

/* 视频加载状态 */
.video-loading {
    display: inline-block;
    width: 280px;
    height: 160px;
    background: #f0f0f0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}

.video-loading::before {
    content: '📹 视频加载中...';
}

/* 响应式视频样式 */
@media (max-width: 768px) {
    .message.video-message {
        max-width: 280px;
    }

    .message-video {
        max-width: 240px;
        max-height: 160px;
    }

    .video-container {
        padding: 6px;
    }

    .video-description {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .message.video-message {
        max-width: 260px;
    }

    .message-video {
        max-width: 220px;
        max-height: 140px;
    }
}

.image-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.image-loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 14px;
}

/* 图片预览模态框 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.image-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* @建议框样式 */
.at-suggestion-box {
    position: absolute;
    bottom: 100px;
    left: 30px;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 100;
    min-width: 200px;
    animation: fadeInUp 0.3s ease-out;
}

.at-suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
}

.at-suggestion-item:hover,
.at-suggestion-item.active {
    background: #f0f8ff;
    border-left: 3px solid #07C160;
}

.at-suggestion-item i {
    color: #07C160;
    font-size: 18px;
}

.at-suggestion-item span {
    font-weight: 600;
    color: #333;
}

.at-suggestion-item small {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

/* AI机器人消息样式 */
.message.ai-robot {
    align-self: flex-start;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border: 2px solid #2196F3;
    border-bottom-left-radius: 5px;
    position: relative;
    overflow: hidden;
}

.message.ai-robot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.message.ai-robot .message-header {
    color: #1976D2;
}

.message.ai-robot .sender-name {
    font-weight: 700;
}

.message.ai-robot .sender-name i {
    color: #2196F3;
    margin-right: 5px;
    animation: robotBlink 2s infinite;
}

@keyframes robotBlink {
    0%, 50% {
        opacity: 1;
    }
    25% {
        opacity: 0.5;
    }
}

.message.ai-robot .message-content {
    color: #1565C0;
    font-weight: 500;
}

/* 表情包面板样式 */
.sticker-panel {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: 90vw;
    max-height: 480px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: none;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.sticker-panel.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.sticker-header {
    background: linear-gradient(135deg, #07C160, #06A84F);
    color: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.sticker-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sticker-header h4::before {
    content: '🎭';
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sticker-content {
    padding: 20px 24px;
    max-height: 380px;
    overflow-y: auto;
    background: #fafbfc;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    justify-items: center;
    min-height: 200px;
}

.sticker-item {
    width: 75px;
    height: 75px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 3px solid transparent;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: stickerFadeIn 0.4s ease-out;
    animation-fill-mode: both;
}

.sticker-item:nth-child(1) {
    animation-delay: 0.05s;
}

.sticker-item:nth-child(2) {
    animation-delay: 0.1s;
}

.sticker-item:nth-child(3) {
    animation-delay: 0.15s;
}

.sticker-item:nth-child(4) {
    animation-delay: 0.2s;
}

.sticker-item:nth-child(5) {
    animation-delay: 0.25s;
}

.sticker-item:nth-child(6) {
    animation-delay: 0.3s;
}

.sticker-item:nth-child(7) {
    animation-delay: 0.35s;
}

.sticker-item:nth-child(8) {
    animation-delay: 0.4s;
}

.sticker-item:nth-child(9) {
    animation-delay: 0.45s;
}

.sticker-item:nth-child(10) {
    animation-delay: 0.5s;
}

.sticker-item:nth-child(11) {
    animation-delay: 0.55s;
}

.sticker-item:nth-child(12) {
    animation-delay: 0.6s;
}

.sticker-item:nth-child(13) {
    animation-delay: 0.65s;
}

.sticker-item:nth-child(14) {
    animation-delay: 0.7s;
}

.sticker-item:nth-child(15) {
    animation-delay: 0.75s;
}

.sticker-item:nth-child(16) {
    animation-delay: 0.8s;
}

.sticker-item:hover {
    transform: scale(1.15) rotate(2deg);
    border-color: #07C160;
    box-shadow: 0 8px 25px rgba(7, 193, 96, 0.4);
    z-index: 10;
}

.sticker-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sticker-item:hover::before {
    opacity: 1;
}

.sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
    transition: transform 0.3s ease;
    display: block;
}

.sticker-item:hover img {
    transform: scale(1.1);
}

.sticker-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
}

.sticker-loading i {
    font-size: 20px;
    color: #07C160;
}

/* 表情包空状态 */
.sticker-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.sticker-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.sticker-empty h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #666;
}

.sticker-empty p {
    margin: 0;
    font-size: 14px;
    color: #999;
}

.sticker-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-top: 1px solid #f0f0f0;
    background: linear-gradient(to bottom, #fafbfc, #f8f9fa);
    margin: 0 -24px -20px -24px;
    border-radius: 0 0 20px 20px;
}

.page-btn {
    background: linear-gradient(135deg, #07C160, #06A84F);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.page-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
    background: linear-gradient(135deg, #F7931E, #E8851B);
}

.page-btn:disabled {
    background: linear-gradient(135deg, #d0d0d0, #c0c0c0);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    background: rgba(255, 107, 53, 0.1);
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .sticker-panel {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        bottom: 120px;
        max-height: 420px;
        transform: none;
    }

    .sticker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        min-height: 160px;
    }

    .sticker-item {
        width: 65px;
        height: 65px;
    }

    .sticker-content {
        padding: 16px 20px;
        max-height: 300px;
    }

    .sticker-header {
        padding: 14px 20px;
    }

    .sticker-header h4 {
        font-size: 16px;
    }

    .sticker-pagination {
        padding: 14px 20px;
        margin: 0 -20px -16px -20px;
    }

    .page-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .page-info {
        font-size: 13px;
        padding: 5px 10px;
    }
}

/* 礼物面板样式 */
.gift-panel {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    max-width: 90vw;
    max-height: 520px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: none;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.gift-panel.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.gift-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.gift-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gift-header h4::before {
    content: '🎁';
    font-size: 20px;
}

.gift-content {
    padding: 20px 24px;
    max-height: 420px;
    overflow-y: auto;
    background: #fafbfc;
}

.gift-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-items: center;
    min-height: 200px;
}

.gift-item {
    width: 120px;
    height: 140px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 3px solid transparent;
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: giftFadeIn 0.4s ease-out;
    animation-fill-mode: both;
    padding: 12px;
}

.gift-item:nth-child(1) {
    animation-delay: 0.05s;
}

.gift-item:nth-child(2) {
    animation-delay: 0.1s;
}

.gift-item:nth-child(3) {
    animation-delay: 0.15s;
}

.gift-item:nth-child(4) {
    animation-delay: 0.2s;
}

.gift-item:nth-child(5) {
    animation-delay: 0.25s;
}

.gift-item:nth-child(6) {
    animation-delay: 0.3s;
}

.gift-item:nth-child(7) {
    animation-delay: 0.35s;
}

.gift-item:nth-child(8) {
    animation-delay: 0.4s;
}

.gift-item:nth-child(9) {
    animation-delay: 0.45s;
}

@keyframes giftFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gift-item:hover {
    transform: scale(1.05) rotate(1deg);
    border-color: #ff6b6b;
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
    z-index: 10;
}

.gift-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gift-item:hover::before {
    opacity: 1;
}

.gift-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
}

.gift-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 4px;
    line-height: 1.2;
}

.gift-value {
    font-size: 12px;
    color: #ff6b6b;
    font-weight: 700;
    background: linear-gradient(135deg, #ffe6e6, #fff0f0);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #ffcccc;
}

.gift-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
}

.gift-loading i {
    font-size: 20px;
    color: #ff6b6b;
}

/* 礼物消息样式 */
.message.gift {
    background: linear-gradient(135deg, #ffe6e6, #fff0f0);
    border: 2px solid #ff6b6b;
    position: relative;
    overflow: hidden;
}

.message.gift::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.message.gift .message-header {
    color: #ee5a24;
}

.message.gift .sender-name {
    font-weight: 700;
}

.message.gift .sender-name i {
    color: #ff6b6b;
    margin-right: 5px;
}

.message.gift .message-content {
    color: #d63031;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gift-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.gift-animation {
    position: relative;
    width: 80vmin;
    height: 80vmin;
    max-width: 600px;
    max-height: 600px;
    animation: giftAnimationShow 3s ease-out forwards;
}

@keyframes giftAnimationShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

@keyframes giftSimpleShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* 增强礼物特效动画 */
@keyframes giftEnhancedShow {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
        transform: scale(1.1);
    }
    90% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes giftBgPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

@keyframes giftBounce {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.3);
    }
    30% {
        opacity: 0.8;
        transform: translateY(10px) scale(1.2);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(0.9);
    }
    80% {
        transform: translateY(3px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes giftIconScale {
    0% {
        transform: scale(0.8);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.0);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes giftTextGlow {
    0% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 107, 107, 0.5);
    }
    100% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 107, 107, 0.8);
    }
}

@keyframes giftParticle {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    80% {
        opacity: 0.8;
        transform: translateY(-80px) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) scale(0);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .gift-panel {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        bottom: 120px;
        max-height: 460px;
        transform: none;
    }

    .gift-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        min-height: 160px;
    }

    .gift-item {
        width: 100px;
        height: 120px;
        padding: 10px;
    }

    .gift-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 6px;
    }

    .gift-name {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .gift-value {
        font-size: 11px;
        padding: 1px 6px;
    }

    .gift-content {
        padding: 16px 20px;
        max-height: 340px;
    }

    .gift-header {
        padding: 14px 20px;
    }

    .gift-header h4 {
        font-size: 16px;
    }

    .gift-animation {
        width: 200px;
        height: 200px;
    }
}
